/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = frct_hash.h                                        */
/*  NOTE      = conntrack管理hash                                  */
/*  DATE      = 2014/10/20 by yaohl                                */
/*******************************************************************/

#ifndef __FRCT_HASH_H_
#define __FRCT_HASH_H_

int  frct_hash_init(unsigned int ui_table_size);
void frct_hash_destory(list_node_free pf_free);

int frct_hash_key(u_short us_proto, u_int ui_src, u_short us_sport, u_int ui_dest, u_short us_dport
                , char *p_key, unsigned int ui_key_size);
Frlist_node *frct_hash_add(Conntrack *p_st_ct, char *p_key, int i_key_len);
Frlist_node *frct_hash_get(u_short ip_proto
                           , u_int ui_src
                           , u_short us_port
                           , u_int ui_dest
                           , u_short us_dport);
int frct_hash_del(Frlist_node *p_st_node);
void frct_hash_output(char **pp_result);
void frct_hash_run(void *p_data, list_node_run pf_run);

void frct_hash_wlock(void);
void frct_hash_unwlock(void);
void frct_hash_rlock(void);
void frct_hash_unrlock(void);

#endif
